import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 出库单查询界面
export const searchAdjustOrder = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts`, { params });
// 锁定单号
export const isLocked = (allocateOutNo, params) => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/isLocked/${allocateOutNo}`, { params });
// 查询备件库存明细
export const queryInventory = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/${partNo}/${storageCode}`, { params });
// 根据调拨出库单号作废单据
export const quit = (allocateOutNo, params) => axios.delete(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/delete/${allocateOutNo}`, { params });
// 根据调拨出库单号调拨出库入账
export const accountEntey = (allocateOutNo, params) => axios.delete(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/enterRecord/${allocateOutNo}`, { params });
// 查询仓库列表
export const getStorageList = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/Storage/Select`, { params });

// 根据调拨出库单号查询主表数据
export const queryMainTableByNo = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/Items/${params}`);
// 新建出库单查询备件列表
export const queryPartForAdd = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/findPartForAdd`, { params });
// 根据备件仓库及备件代码获取备件详情
export const queryPartDetail = (partNo, storageCode) => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/${partNo}/${storageCode}`);
// 保存新建出库单（修改）
export const saveOutboundOrderCreate = params => axios.post(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/save`, params);
// 出库单入账
export const outBoundOrderRecorded = allocateOutNo => axios.post(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/enterRecord/${allocateOutNo}`);
// 出库单作废
export const outBoundOrderDelete = allocateOutNo => axios.delete(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/delete/${allocateOutNo}`);
// 出库单修改

// 打印数据获取
export const printData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/queryPrintOutData/${params}`);

// 调拨出库导出
export const partAllocateOutExportExcel = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/export/${params}`, { params, responseType: 'arraybuffer' });
// 关联借进入库
export const queryAllocateInList = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partallocateouts/allocatein/list`, { params });
